/**
  ******************************************************************************
  * @file           : xgzp6847d.h
  * @author         : Mark Xiang
  * @brief          : brief
  ******************************************************************************
  * @attention
  *
  ******************************************************************************
  */
#ifndef __XGZP6847D_H
#define __XGZP6847D_H
/* ------------------------------ Includes ------------------------------ */

/* ------------------------------ Defines ------------------------------ */

/* device address */
#define XGZP6847D_WRITE_ADDR    0xDA
#define XGZP6847D_READ_ADDR     0xDB

/* register address */
#define SPI_CTRL_REG            0x00
#define PART_ID_REG             0x01
#define STATUS_REGE             0x02
#define DATA_MSB_REG            0x06
#define DATA_CSB_REG            0x07
#define DATA_LSB_REG            0x08
#define TEMP_MSB_REG            0x09
#define TEMP_LSB_REG            0x0A
#define COMMAND_REG             0x30
#define OTP_CMD_REG             0x6C
#define MODE_CTRL_REG           0xA5

/* measure commands */
#define TEMPERATURE_ONLY        0x08
#define PRESSURE_ONLY           0x09
#define TEMP_PRESS_BOTH         0x0A

/* ------------------------------ Enum Typedef ------------------------------ */

/* ------------------------------ Struct Typedef ------------------------------ */

/* ------------------------------ Variable Declarations ------------------------------ */

/* ------------------------------ Manager Typedef ------------------------------ */

typedef struct Xgzp6847dManager
{
/**
  * @brief  Initiate XGZP6847D & set it to output corrected value.
  * @retval None
  */
  void (*Init)(void);

/**
  * @brief  Get the value of pressure.
  * @retval pressure in kPa
  */
  float (*ReadPressure)(void);
}Xgzp6847dManager_typedef;

/* ------------------------------ Manager Extern ------------------------------ */

extern Xgzp6847dManager_typedef PressSensor;

#endif

